package com.wushibo.adddatabackend.service.impl;

import com.wushibo.adddatabackend.entity.CountryData;
import com.wushibo.adddatabackend.entity.PersonInformation;
import com.wushibo.adddatabackend.entity.ProvinceData;
import com.wushibo.adddatabackend.mapper.AddCountryDataMapper;
import com.wushibo.adddatabackend.mapper.AddDataMapper;
import com.wushibo.adddatabackend.mapper.PersonInforMapper;
import com.wushibo.adddatabackend.service.AddDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AddDataServiceImpl implements AddDataService {
    @Autowired
    private AddDataMapper addDataMapper;
    @Autowired
    private AddCountryDataMapper addCountryDataMapper;

    @Autowired
    private PersonInforMapper personInforMapper;

    @Override
    public int addProvinceData(ProvinceData provinceData) {
        int i=addDataMapper.insert(provinceData);
        if(i==1){
            System.out.println("接口运行成功");
            return 1;
        }else{
            return 0;
        }
    }

    @Override
    public int addCountryData(CountryData countryData) {
        int j=addCountryDataMapper.insert(countryData);
        if(j==1){
            System.out.println("接口运行成功");
            return 1;
        }else{
            return 0;
        }
    }

    @Override
    public int personInformation(PersonInformation personInfor) {
        int k=personInforMapper.insert(personInfor);
        if(k==1){
            System.out.println("接口运行成功");
            return 1;
        }else{
            return 0;
        }
    }
}
